"""专门读取JSON数据的工具类"""
import json

from config import BASE_DIR


def build_data():
    with open(BASE_DIR + r"/Day10/data/05_data.json", encoding="UTF8") as file:
        data_list = json.load(file)

        # 将数据, 组织为[(), (), ()]的形式
        temp_list = []
        for data in data_list:
            temp_tuple = tuple(data.values())
            temp_list.append(temp_tuple)

        return temp_list


if __name__ == '__main__':
    print(BASE_DIR + r"/Day10/data/05_data.json")
    result = build_data()
    print(result)
